package seed_system

import (
	"fmt"
	"gitee.com/theegg/go-brick/app/model/system/system_modules"
	"gitee.com/theegg/go-brick/app/service/app"
)

func InitSystemModulesSeed() {
	items := make(map[int]system_modules.SystemModules)

	items[1] = system_modules.SystemModules{
		Title:      "首页轮播图",
		Sign:       "index_carousel",
		ModuleType: 1,
		ImageList:  "",
		LinkList:   "",
		NodeList:   "",
		Mark:       "首页鹿流播放图",
		Status:     true,
	}

	count := 0
	errCount := 0
	for _, item := range items {
		_, err := app.Db().Insert(item)
		if err != nil {
			fmt.Println(err.Error())
			errCount++
		} else {
			count++
		}
	}

	fmt.Printf("%5s|%25s|%10d|%8d|\n", "", "system_modules", count, errCount)
}
